class Api::V1::TeamsController < Api::V1::BaseController
  skip_before_action :authenticate_request!

  def index
    @teams = Team.all
    if params[:search_key].presence
      @teams = @teams.where("name LIKE ?", "%#{params[:search_key]}%")
    end
    @teams = @teams.order("created_at DESC").page(params[:page]).per(params[:per])
  end
end
